package com.flyxiaozhu.erp.core.repositories;

import com.flyxiaozhu.erp.core.entities.IdSequence;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface IdSequenceRepository extends JpaRepository<IdSequence, Long> {
    @Query(value = "TRUNCATE TABLE id_sequence", nativeQuery = true) // TRUNCATE TABLE 删除所有数据
    @Modifying
    @Transactional
    void resetId();
}
